﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

public class NullLiteral : Literal<string>
{
    internal NullLiteral(SyntaxNode? parent) : base(SyntaxKinds.Null, "Null", parent)
    {
    }
}


public static partial class NodeFactory
{
    public static NullLiteral CreateNullLiteral(SyntaxNode? parent = null)
    {
        return new NullLiteral(parent);
    }


    public static NullLiteral CreateNullLiteral(SourceNode source)
    {
        Debug.Assert(source.IsNode(SyntaxKinds.NullKeywordToken));
        NullLiteral literal = CreateNullLiteral();
        literal.UpdateFrom(source);
        return literal;
    }
}